package com.wing.common.services;

import javax.servlet.ServletConfig;

import org.springframework.web.context.WebApplicationContext;

import com.wing.common.Constants;

public class SpringDIService extends Service {

	private static WebApplicationContext wac = null;

	public Object getBean(String beanName) {
		return (wac.getBean(beanName));
	}

	protected void init(ServletConfig aConfig) throws Exception {
		wac = (WebApplicationContext) aConfig.getServletContext()
				.getAttribute(Constants.SPRING_SERVLET_DISPLAY_NAME);
	}

}
